<?php 
    if (isset($categoria['children'])):
        echo '<div class="destaque">';
            foreach ($categoria['children'] as $child):
                if( $child['status'] == 1 ){
                    $link = 'JavaScript:void(0);';
                    if( $child['pagina_id'] != 0 )
                        $link = 'http://'.$_SERVER['SERVER_NAME'].'/paginas/index/'.$child['pagina_id'].'/'.$child['nome'];

                    if( $child['url'] != '' && $child['url'] != null )
                        $link = 'http://'.str_replace('http://', '', str_replace('{url_do_site}', $_SERVER['SERVER_NAME'], $child['url']));

                    echo '<h2><a href=' . $link . '>' . $child['nome'] . '</a></h2>';
                    echo $this->element('categorias_children2', array('categoria' => $child));
                }
             endforeach;
        echo '</div>';
     endif;
?>